<?
global $db;
$s = inc_incfile(basename(dirname(__FILE__))."/setup.php",$params);

$value = $params["value"];
$p = array();

if (strcmp(intval($value),$value)==0) {
	$e = $db->query1("select id,{$s["field"]} as _title from {$s["table"]} where id = ".$db->sqlint($value));
	$p["title"] = $e["_title"];
	}
	
if (strcmp($value,"new")==0) {
	$p["title"] = "New {$s["title"]}";
	}
	
return $p;
?>